package com.wyl.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 研究
 * 1.系统普通的控制台打印 和 日志打印的区别，在linux上怎么看。打印的效果是怎么样的
 */
@RestController("/log")
public class LogController {

    private static final Logger logger = LoggerFactory.getLogger(LogController.class);

    @GetMapping("/info")
    public String info(String param){
        logger.info("param: {}", param);
        return param;
    }

    @GetMapping("/error")
    public String error(String param){
        logger.error("param: {}", param);
        logger.error("error方法被调用", new NullPointerException());
        return param;
    }

}
